package com.xiaoshuidi.cloud.module.rooms.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaoshuidi.cloud.module.rooms.controller.admin.iot.vo.RoomSdiotAssocationVo;
import com.xiaoshuidi.cloud.module.rooms.pojo.RoomSdiotAssociation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 * 预警设置关联的房源表 Mapper 接口
 * </p>
 *
 * @author James
 * @since 2023-05-29
 */
@Mapper
public interface RoomSdiotAssociationMapper extends BaseMapper<RoomSdiotAssociation> {
    @Select("select rsa.*,rh.apartment_id apartmentId from room_sdiot_association rsa left join room_house rh on rsa.room_id=rh.id " +
            "where ${ew.sqlSegment}")
    List<RoomSdiotAssocationVo> getWaringInfo(@Param("ew") QueryWrapper<?> wrapper);
}
